<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">					

			<p:fieldset legend="#{messages['product.label']}" toggleable="true" toggleSpeed="500">
				<h:panelGrid id="fieldsProduct" columns="2">																			
				
					<h:outputLabel value="#{messages['product.label.itemname']}: " for="itemname" styleClass="text-input" />
					<h:outputText id="itemname" value="#{productEditMB.bean.itemName}"
						title="#{messages['product.alt.itemname']}" />
				
					<h:outputLabel value="#{messages['product.label.description']}: " for="description" styleClass="text-input" />
					<h:outputText id="description" value="#{productEditMB.bean.description}"
						title="#{messages['product.alt.description']}" />
					
					<h:outputLabel value="#{messages['product.label.quantity']}: " for="quantity" styleClass="text-input" />
					<h:outputText id="quantity" value="#{productEditMB.bean.quantity}"
						title="#{messages['product.alt.quantity']}" />					
					
					<h:outputLabel value="#{messages['product.label.price']}: " for="price" styleClass="text-input" />
					<h:outputText id="price" value="#{productEditMB.bean.price}"
						title="#{messages['product.alt.price']}" />										
					
				</h:panelGrid>
			</p:fieldset>
						
			<br />
			<br />					
			
			<h:form>
				<p:fieldset legend="!!!Compra" toggleable="true" toggleSpeed="500">
					<h:panelGrid id="fieldsBuy" columns="7">											
					
					<h:commandButton value="+" update="quantity-to-buy" actionListener="#{sellMB.increaseQuantity(productEditMB.bean)}">
						<f:param name="productId" value="#{productEditMB.bean.id}" />
					</h:commandButton>
					<h:outputLabel value="/" />
					<h:commandButton value="-" update="quantity-to-buy" actionListener="#{sellMB.decreaseQuantity}"/>
					
					<h:outputLabel value="!!!Quantidade" for="quantity-to-buy" styleClass="text-input" />
					<h:inputText id="quantity-to-buy" value="#{sellMB.quantity}" title="#{messages['product.alt.quantity']}" />
					
					<h:commandButton value="!!!Comprar" action="#{sellMB.sellProduct(productEditMB.bean)}" >
						<f:param name="productId" value="#{productEditMB.bean.id}" />				
					</h:commandButton>						
					
					</h:panelGrid>
				</p:fieldset>
			</h:form>
	</ui:define>
</ui:composition>